package com.bd.scm.module.user.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bd.scm.domain.dto.user.PersonnelFilesDto;
import com.bd.scm.domain.dto.user.UserDto;
import com.bd.scm.domain.models.user.DtFace;
import com.bd.scm.domain.models.user.DtUser;
import com.bd.scm.domain.models.user.UserInfo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public interface IFaceService  extends IService<DtFace> {

    /**
     * 新增数据
     * @param face
     * @return
     */
    int add(DtFace face);

    /**
     * 根据用户ID获取数据
     * @param userId
     * @return
     */
    DtFace getByUserId(Long userId);

    /**
     * 新增用户和人脸照片
     * @param files
     * @param userDto
     */
    DtUser addUserWithFace(List<MultipartFile> files, PersonnelFilesDto userDto, String clentIp) throws IOException;

    /**
     * 拍照
     * @param file
     * @param userInfo
     * @return
     */
    Boolean takePhoto(MultipartFile file, UserInfo userInfo) throws IOException;

    /**
     * 导入人脸照片2
     *
     * @param file
     */
    JSONObject addFace(MultipartFile file, String clentIp, String loginer) throws IOException;

    String responseFileStream(String userId, HttpServletResponse response);
}
